import request from '@/utils/request'
import { downFile } from '@/utils/request'
// 查询单位列表
export function listUnitmeasure(query) {
    return request({
      url: '/mes/md/unit/list',
      method: 'get',
      params: query
    })
  }


  //根据主键查询单条unit
  export function getUnitmeasure(query) {
    return request({
      url: '/mes/md/unit/getUnit/'+query,
      method: 'get',
    })
  }
  
  export function updateUnitmeasure(data) {
    return request({
      url: '/mes/md/unit/updateUnit',
      method: 'post',
      data: data
    })
  }

  export function addUnitmeasure(data) {
    return request({
      url: '/mes/md/unit/addUnit',
      method: 'post',
      data: data,
      contextType:"application/json"
    })
  }

  
  export function delUnitmeasure(id) {
    return request({
      url: '/mes/md/unit/delUnit/'+id,
      method: 'delete',
    })
  }


  // 导出单位
export async function exportUnit(query) {

  await downFile('/mes/md/unit/exportUnit/', { ...query }) 
  
}
